﻿-- ================================================
-- Remarks: Not part of standard Stored Proc
-- ================================================

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'Ivy_UserManagement_UserOrganizationRole_Delete')
	BEGIN
		DROP  Procedure  [Ivy_UserManagement_UserOrganizationRole_Delete]
	END
GO

CREATE PROCEDURE [Ivy_UserManagement_UserOrganizationRole_Delete]

-- =============================================
-- Author:		<Ram pravesh kr>
-- Create date: <29/06/2016>
-- Description:	<Ivy_UserManagement_UserOrganizationRole_Delete>
-- =============================================

-- Add the parameters for the stored procedure here

	(
				@UserKey int = NULL, 
				@UserOrganizationKey int = NULL, 
				@UserRoleKey int = NULL 
	) 
AS 
BEGIN 
	-- SET NOCOUNT ON added to prevent extra result sets from interfering with SELECT statements. 
	SET NOCOUNT OFF; 

    DELETE  FROM [UserOrganizationRole] 
    WHERE 
		( 
			[UserKey] = @UserKey AND 
			[UserOrganizationKey] = @UserOrganizationKey AND 
			[UserRoleKey] = @UserRoleKey 
		); 

END 
GO 

-- =================================END=====================================

